#! /bin/sh
############################################################
#
#   This scripts puts together the distributions
#   Created April 14, 2006 by Jose L. Cuevas
#
#   You need a file in ./Docs/ named release_$ver.txt
#
############################################################

if [ $# != 1 ]; then
 echo "usage: create_distros.sh version"
 exit 0
fi

ver="$1"
echo "Preparing distributions for release $ver"

rm -R ./Distributions
mkdir ./Distributions

echo "BAXIC Release $ver" > ./Distributions/readme.txt
cat ./Docs/readme.txt >> ./Distributions/readme.txt
cat "./Docs/release_$ver.txt" >> ./Distributions/readme.txt

############################################################
#	mac distribution
############################################################
mkdir ./Distributions/macosx
cp ./Distributions/readme.txt ./Distributions/macosx/readme.txt
cp ./baxic ./Distributions/macosx/baxicx
cp ./kLang_Keywords.dt ./Distributions/macosx/kLang_Keywords.dt
#cp ./Samples ./Distributions/macosx/

############################################################
#	windows distribution
############################################################
mkdir ./Distributions/windows
mkdir ./Distributions/windows/BAXIC
cp ./Distributions/readme.txt ./Distributions/windows/readme.txt
cp ./baxic.exe ./Distributions/windows/BAXIC/baxic.exe
cp ./kLang_Keywords.dt ./Distributions/windows/BAXIC/kLang_Keywords.dt
#cp ./Samples ./Distributions/windows/BAXIC/
cp ./windows_installer/install.exe ./Distributions/windows/

############################################################
#	mac console distribution
############################################################
mkdir ./Distributions/macosx_console
cp ./Distributions/readme.txt ./Distributions/macosx_console/readme.txt
cp ./kLang_Keywords.dt ./Distributions/macosx_console/
cp ./Console/install.sh ./Distributions/macosx_console/
cp ./Console/manpage.txt ./Distributions/macosx_console/
cp "./Docs/install console.rtf" ./Distributions/macosx_console/install.rtf
cp -R ./baxic_con ./Distributions/macosx_console/baxic
#cp ./Samples ./Distributions/macosx_console/

############################################################
#	compress distributions
############################################################
echo Creating zip files...
zip -rq "./Distributions/windows_$ver.zip" ./Distributions/windows
zip -rq "./Distributions/macosxcon_$ver.zip" ./Distributions/macosx_console
zip -rq "./Distributions/macosx_$ver.zip" ./Distributions/macosx

zip -rq ./Distributions/samples.zip ./Samples
rm -f ./Distributions/readme.txt

echo Distros are done...
